package com.liyunc.toolset.utils;

/**
 * Copyright (c) 2018-2023 ThunderSoft
 * All Rights Reserved by Thunder Software Technology Co., Ltd and its affiliates.
 * You may not use, copy, distribute, modify, transmit in any form this file
 * except in compliance with ThunderSoft in writing by applicable law.
 */

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author liyuncong
 * @version 1.0
 * @file ArgUtils
 * @brief ArgUtils
 * @details ArgUtils
 * @date 2023-02-16
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2023-02-16                  liyuncong          Created
 */
public class ArgUtils {

    public static final Pattern NUMBER_PATTERN = Pattern.compile("-?[0-9]+(\\\\.[0-9]+)?");

    /**
     * 通过正则表达式判断字符串是否为数字
     */
    public static boolean isNumber(String str) {
        Matcher m = NUMBER_PATTERN.matcher(str);
        return m.matches();
    }

}
